import { createResource, Suspense } from "solid-js";
import asleep from "@/common/asleep";
import Pending from "@/components/Pending";

export default function LoadDataView() {
  document.title = "Load Data";

  const [data] = createResource(async () => {
    await asleep(2000);
    return { data: "Data has been loaded!" };
  });

  return (
    <Suspense fallback={<Pending />}>
      <div>{data()?.data}</div>
    </Suspense>
  );
}
